package com.zhoukun.cloud.controller;

import com.zhoukun.cloud.CommentRest;
import com.zhoukun.cloud.pojo.tOrder;
import com.zhoukun.cloud.service.seataOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhoukun 86547462@qq.com
 * @version 1.0
 * @date 2020/11/2 21:43
 */
@RestController
public class orderController {


    @Autowired
    seataOrderService service;
    @PostMapping("/order/createOrder")
    public CommentRest create(@RequestBody tOrder order)
    {
        System.out.println("=========================================================>>>");
//        return new CommentRest().setData(order);
       return service.create(order);
    }


    @GetMapping("/order/getall")
    public CommentRest create()
    {
        return new CommentRest().setCode(200).setMessage("success").setData(service.list());
    }

}
